package test.test2;

public class CalculateFactory {
    public Computer fangFa(String type){
        Computer computer=null;
        switch (type){
            case "加":
                computer=new Add();
                break;
            case "减":
                computer=new Reduce();
                break;
            case "乘":
                computer=new Ride();
                break;
            case "除":
                computer=new Except();
                break;
            default:
                System.out.println("没有这种");
                break;
        }
        return computer;
    }
}
